function validate(){
	
	var no=$$('no');
	var name=$$('name');
	var password=$$('password');
	var email=$$('email');
	var job=$$('job');
	var status=$$('status');
	var idcard=$$('idcard');
	var telephone=$$('telephone');
	if(no.val()!=""&&name.val()!=""&&password.val()!=""&&email.val()!=""&&job.val()!=""&&idcard.val()!=""&&telephone.val()!=""&&status.val()!="no"){
		return true;
	}
	alert("请认真核对必填项！");
	return true;
}

function check(name){
	var no=$$(name);
	if(no.val()==null||no.val()=="")
		no.addClass("error");
    else 
    	no.removeClass("error");
}

function checko(name){
	var no=$$(name);
	if(no.val().length<6||no.val()=='')
		no.addClass("error");
    else 
    	no.removeClass("error");
}
function getemp(){
	var url="/pms/tran_getemp.action";
	var depart=$('#od').val();
	var opts=document.getElementById("emp");
	opts.options.length=0;//把select清空
	opts.options[0]=new Option("=请选择=","",false,false);
	$.ajax({
		url:url,
		type:'post',
		dataType:'xml',
		data:'depart='+depart,
		success:function(response){
			 //alert(response);
			 $(response).find("emps").each(function(i){
                var name = $(this).find("name").text();
		          opts.options[i+1]=new Option(name,name,false,false);
			  });
			  opts.options[0].selected=true;				
			
		}//success
	 });
}
function $$(name){
	return $(document.getElementsByName(name)[0]);
}